package com.tmxk.days01.demo3_pets_wmh;

import com.tmxk.days01.demo3_pets_wmh.Dog;

import javax.swing.*;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请选择你的宠物类型： 1.狗  2.猫  3.狗  4.鱼");
        int chooseType = sc.nextInt();
        //实例宠物的业务操作类
        PetOperation oper = new PetOperation();
        Pet pet = oper.getPetInfo(chooseType);
        oper.petEatOrShout(oper.getPetInfo(chooseType));
        // Pet pet = new Dog("小黄，",2,"田园犬", "小型");
        //向下转型需要注意 强制转换的数据类型是否是准确的，需通过，instanceof关键字进行判断
        //((Dog)pet).gatekeeper();
        //if (pet instanceof Dog) {
        //  System.out.println("");
        sc.close();

    }
}

